using System.Windows;
using System.Windows.Media;
using System.Windows.Shapes;
using Crusades.Geometry;
using Crusades.Helpers;
using Microsoft.Silverlight.Testing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Crusades_UT.Geometry{
  [TestClass]
  public class PathBuilder_UT{
    [TestMethod]
    public void canAddLine(){
      PathBuilder builder = new PathBuilder(new Point(10,10),new SolidColorBrush(Colors.Black),1 );
      Path path =  builder.AddLineSegment(new Point(20, 20));
      Point start = path.GetFigures()[0].StartPoint;
      Assert.AreEqual(10,start.X);
      Assert.AreEqual(10,start.Y);
      LineSegment segment = path.GetSegments(0)[0] as LineSegment;
      Assert.IsNotNull(segment,"first segment was not a line segment");
      Assert.AreEqual(segment.Point,new Point(20,20));
    }
  }

}